#ifndef LINECHART_H
#define LINECHART_H

#include <QWidget>
#include <QtCharts>
#include <QtCharts/QSplineSeries>
#include <QtCharts/QLineSeries>

#include "src/device/Handle/HandleHelper.h"

using namespace QtCharts;
namespace Ui {
class LineChart;
}

class LineChart : public QWidget
{
    Q_OBJECT

public:
    explicit LineChart(QWidget *parent = 0);
    ~LineChart();

    void initUI();

    void flushData(double*);
private slots:
    void on_btn_clear_clicked();

    void on_comboBox_currentIndexChanged(int index);
    void on_next_clicked();

signals:
    void updateChart(int index);
private:
    Ui::LineChart *ui;
    QChart *chart;
    QSplineSeries *series1;
    QSplineSeries *series2;
    QSplineSeries *series3;
    /// 线程同步锁
    //QLineSerial *m_serial;
};

#endif // LINECHART_H
